/**
 * @author 郑佳超
 * @since 2017-4-6
 */
ADF.PartFactory = function PartFactory(controlList) {
    this.controlList = controlList;
    ADF.PartFactory.superclass.constructor.call(this);
};
COM.util.defineClass(ADF.PartFactory, COM.gef.EditPartFactory,{
    createEditPart: function (context, model) {
        var part = null;
        for(var i = 0 ; i < this.controlList.length; i++){
            var control = this.controlList[i];
            var m = control.getModel();
            var ep = control.getEditpart();
            if(model.constructor === m){
                part = new ep();
                break;
            }
        }
        part.setModel(model);
        return part;
    }
});
